package Object_demo;

public class StringBuild案例 {
    public static void main(String[] args) {
        int[] a={1,2,3};
        System.out.println(pj(a));//[123]

    }
    public static String pj(int[] s){

        if (s!=null) {
            StringBuilder a=new StringBuilder("[");
            for (int i = 0; i < s.length; i++) {
                a.append(s[i]);
            }
            a.append("]");
            return a.toString();
        }else{
            return null;
        }
    }
}
